 package com.briup.cms.utils;

 import java.util.HashMap;
 import java.util.Map;

 public class SecurityUtils
 {
  private static ThreadLocal<Map<String, String>> threadLocal = new ThreadLocal<>();

   public static String get(String key) {
    if (threadLocal.get() == null) {
      return null;
   }
     return (String)((Map)threadLocal.get()).get(key);
   }

  public static void setMap(Map<String, String> map) {
/* 23 */     threadLocal.set(map);
/*    */   }

  public static void setKV(String key, String value) {
    if (threadLocal.get() == null) {
     Map<String, String> map = new HashMap<>();
    threadLocal.set(map);
    }
    ((Map<String, String>)threadLocal.get()).put(key, value);
  }

  public static void setmethod(String method) {
/* 36 */     setKV("method", method);
/*    */   }
  public static String getmethod() {
/* 39 */     return get("method");
/*    */   }

   public static void setRequestURI(String requestURI) {
/* 43 */     setKV("requestURI", requestURI);
/*    */   }
  public static String getRequestURI() {
/* 46 */     return get("requestURI");
/*    */   }

  public static void setUsername(String username) {
/* 50 */     setKV("username", username);
/*    */   }
  public static String getUsername() {
/* 53 */     return get("username");
/*    */   }

  public static void setRealname(String realname) {
/* 57 */     setKV("realname", realname);
/*    */   }
  public static String getRealname() {
/* 60 */     return get("realname");
/*    */   }
 }


